/* ========================================================================
 * Copyright 2007 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless reqired by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================================
 


 * Created on 1 oct. 2007
 * @author pollux
*/
package org.poxd.frisar.model;

/**
 *
 * 
 */
public class Event implements FriseElement {

    private String title;
    private long when;

    public Event(String title, long when)
    {
        this.title = title;
        this.when = when;
    }

    public String getTitle()
    {
        return title;
    }

    public long getStart()
    {
        return when;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (obj == null || !(obj instanceof Event))
        {
            return false;
        }
        Event e = (Event) obj;
        return e.getTitle().equals(title) && e.getStart() == when;
    }

    @Override
    public int hashCode()
    {
        int hash = 7;
        hash = 89 * hash + (this.title != null ? this.title.hashCode() : 0);
        hash = 89 * hash + (int) (this.when ^ (this.when >>> 32));
        return hash;
    }
}
